<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePromoterLevelsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('promoter_levels', function (Blueprint $table) {
            $table->id()->comment('分销等级表');
            $table->integer('user_id')->comment('用户id');
            $table->integer('promoter_id')->comment('分销员id');
            $table->string('position')->comment('职位');
            $table->string('image')->comment('背景图');
            $table->integer('level')->comment('等级');
            $table->integer('first_commission')->comment('一级返佣上浮比例单位(%)');
            $table->integer('second_commission')->comment('二级佣金上浮比例');
            $table->tinyInteger('is_show')->default(1)->comment('是否显示 0隐藏1显示');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('promoter_levels');
    }
}
